Main
Media Control Library

Version 3.0

February 1996

The Media Control Library accesses, controls, formats and displays digital video and digital audio.  This allows designers and programmers of interactive multimedia to integrate audio and video simply and easily as all of the access and control issues are contained in a single dynamic link library.  The benefits of this approach are substantial.

All commands listed below have been designed to adapt to the format of the input file.  Subtle and obvious differences are accounted for and the same commands can be called for digital video and digital audio.

The commands held within this Library have been created to operate within any Windows application that can load and call a dynamic link library.  This includes, but is not limited to Macromedia Authorware and Director, Mcirosoft Visual Basic and Visual C++, Borland Delphi, and Asymetrix Toolbook.

The file formats supported currently are:

MPEG Video

Indeotm Video (Hardware and software decompression)

Video for Windows (.AVI)

Apple Quicktime (.MOV)

SuperMac Cinepak

Digital Video Interactive (DVItm)

AVS (PLV and RTV)

Wave Audio (.WAV)

Whats new from Version 2.0 to Version 3.0?

Enhanced video control

Enhanced audio control

Enhanced error detection & reporting

Video frame capture

User-defined custom controls

Future enhancement possibilities to this DLL include:

Visual Basic OCX (16 and 32 bit)

Microsoft OLE compatibility

Clickable Objects

Video Capture

Transparent video

Other enhancement ideas or requests would be greatly appreciated.  Communicate ideas, concerns and general information by calling
(708) 968-7803, faxing (708) 968-7407 or through CompuServe ID#: 75430, 3543.

Copyright Notices

NOTE: "A/V" refers to video and/or audio files.


Copyright Notice

Information in this document is subject to change without notice.  No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of MediaDynamics Inc.

© 1993, 1994, 1995, 1996 MediaDynamics Inc. All rights reserved.

Limited Warranty

MediaDynamics, Inc. ("MediaDynamics"). warrants that its product will substantially conform to the performance specifications contained in this user guide, provided that the product is used on computer hardware and with an operating system for which it was designed.  In the event of any defects in manufacture or failure to conform to published specifications, MediaDynamics will, at its option, repair or replace defective product at no charge,  Defective product must be received at a MediaDynamics facility within ninety (90) days from date of purchase, accompanied by proof of purchase.  Shipping charges to MediaDynamics shall be prepaid by purchaser.

The foregoing warranty is exclusive and in lieu of all other warranties, express or implied, including but not limited to implied warranty for merchantability or fitness for a particular purpose.  MediaDynamics expressly disclaims any and all liability for any incidental, special or consequential damages arising from the use or inability to use its product, software or documentation.  In no case shall the liability of MediaDynamics exceed the cost of the product.

Some States do not allow the limitation or exclusion of implied warranties or general liability, so the above limitation or exclusion may not apply, solely by operation of the law.

Trademarks

Microsoft, MS, Windows, Visual C++ and Visual Basic are trademarks of Microsoft Corporation.

Intel and Indeo are registered trademarks of Intel Corporation.

Authorware is a registered trademark of MacroMedia Corporation.

Toolbook is a registered trademark of Asymetrix Corporation.

Delphi is a registered trademark of Borland Corporation.

Cinepak is a registered trademark of SuperMac Technologies.

Quicktime is a registered trademark of Apple Computer Inc.

All other products are the trademarks of their respective manufacturers.

Developed and printed in the United States of America.


Benefits

•	Runs in any environment that can utilize Windows Dynamic Link Libraries.

•	Standard set of commands to access and play a wide variety of multimedia files.  The Media Control Library detects and adapts to the current multimedia data type.

•	Self contained error checking and correcting code.

•	Quicker "modular" approach to development.  Multimedia control is handled through a centralized library.  All necessary multimedia commands are provided and fully documented.

•	Documentation includes hard copy and on-line hypertext facility.  Example code is provided for various environments.  Also, to help speed development, declaration code is provided that can easily be copied directly into the application being created.

•	Built-in "Crash-Protection."  The Media Control Library detects shutdown of the application and unloads all necessary data even if an explicit close command is not called.

•	Additional capabilities are provided that are not available in other packages:
-  Simplified user interface

-  Customizable user interface
-  Dragable video window
-  Clickable video window
-  Control bar and video window can be positioned separately if necessary

•	All commands can be called at any time -- this includes during audio or video play.   Media Control Library will detect potential conflicts and perform appropriate operations if necessary.

•	User defined modal and modeless operation.

•	Customizable graphical control interface provided.

•	Option to utilize user defined controls.


List of Functions

A/V File Access

mdClose	mdOpenDevice

mdCloseDevice	mdOpenLite

mdOpen

Cursor Control

mdResetCtrlCursor	mdSetCtrlCursor

mdResetCursor	mdSetCursor

mdResetVideoCursor	mdSetVideoCursor

Error Handling

mdDisplayErrorMsgs	mdGetErrorText

mdGetErrorNumber	mdLogErrors

File Control

mdCloseInterface	mdRestart

mdGotoFrame	mdRewind

mdHide	mdShow

mdHideCtrl	mdShowCtrl

mdHideVideo	mdShowVideo

mdOpenInterface	mdStep

mdPause	mdStop

mdPlay

Informational

mdGetAreaClicked	mdGetPosClicked

mdGetButtonClicked	mdGetVideoWinHeight

mdGetClipFrame	mdGetVideoWinPos*

mdGetClipLength	mdGetVideoWinSize*

mdGetCtrlWinPos*	mdGetVideoWinWidth

mdGetCtrlWinSize*	mdGetVideoWinX

mdGetCtrlWinWidth	mdGetVideoWinY

mdGetCtrlWinX	mdGetWindowHandle

mdGetCtrlWinY	mdGetWinHeight

mdGetDeviceID	mdGetWinPos*

mdGetDisplayState	mdGetWinSize*

mdGetFileName	mdGetWinWidth

mdGetFileType	mdGetWinX

mdGetFrame	mdGetWinY

mdGetLength	mdGetXPosClicked

mdGetOpenFileCount	mdGetYPosClicked

mdGetPlayState	mdGetVolumeLevel

Miscellaneous

mdAbout	mdFileDoesNotExist

mdCDEject	mdMCISendString

mdDisplayErrorMsgs	mdSetTimeFormat

mdFileDoesExist	mdTimedDelay

Parameter Setting

mdSetActivePalette	mdSetPlayRepeat

mdSetAudioLevel	mdSetVideoAspect

mdSetAudioMute	mdSetVideoOffset

mdSetClip	mdSetVideoPalette

mdSetClippingRegion	mdSetVideoWinPos

mdSetCtrlType	mdSetVideoWinSize

mdSetCtrlWinPos	mdSetWinBottom

mdSetCtrlWinSize	mdSetWindowInteractive

mdSetInterfaceNo	mdSetWindowMoveable

mdSetKeyColor	mdSetWinPos

mdSetNewParent	mdSetWinSize

mdSetPlaybackSpeed	mdSetWinTop

Video Graphic Display

mdCloseGraphic	mdHideGraphic

mdDisplayGraphic	mdOpenGraphic

mdGetCtrlWindowHandle	mdOpenGraphicKeep

mdGetFrameRate	mdShowGraphic

mdGetPlayedStatus	mdShowGraphicPos

mdGetVideoImage

Wave Audio Record

mdWaveClose	mdWaveRecordPlayback

mdWaveRecord	mdWaveRecordSave

mdWaveRecordInit

* Because of the function calling conventions of Authorware Professional, these commands are available only within applications that allow the passing of pointers such as Visual Basic and C/C++.


mdAbout

Description:  Displays information about the DLL along with the number of A/V files currently open.  Version information is also displayed through this command.

Parameters:  	None

Return: 	None

Example:	To display current system memory usage and DLL specific information.

-- Authorware --

mdAbout(  )

-- Visual Basic --

 Call mdAbout

See Also:


mdCDEject

Description:  This command will eject the CD, CD caddie or tray from the drive.

Parameters:	None

Return:	None

Example:

-- Authorware --

mdCDEject ( )

-- Visual Basic --

Call mdCDEject


mdClose

Description:  Closes the current open file and releases the associated system resources.

Parameters:  	Handle	Integer. Use the return value from mdOpen as the handle.

Return: 	Success	Integer.  Completion Flag

0 =  Successful

Any non-zero value = Failed to close.

Example:	To close the currently open A/V file.

-- Authorware --

nRet := mdClose( nFileHandle )

or

nFileHandle := mdClose(nFileHandle)

This will set nFileHandle equal to 0 if the close was successful or leave it the same if the close fails.

-- Visual Basic --

nRet = mdClose( nFileHandle )

or

nFileHandle = mdClose(nFileHandle)

This will set nFileHandle equal to 0 if the close was successful or leave it the same if the close fails.

See Also:  	mdOpen


mdCloseDevice

Description:  Closes a video or audio device driver and releases the associated resources.

Parameters:  	DeviceName	String.  This is the name of the device to be closed.

Return:  	If the command was successful, a value of 1 will be returned.  If the command fails a value of 0 is returned.

Example:	To open the MPEG Video device prior to opening an MPEG file.  Then later in the program, close the device.

-- Authorware --

nRet := mdOpenDevice ( "MPEGVideo" )  -- MPEG device is opened

nFileHandle := mdOpen( WindowHandle, "D:\\Video\\Vid1.mpg", 30, 40, 0, 0, 0, 0, 2, 0 )

-- Later in the program ( just before exiting )

mdCloseDevice( "MPEGVideo" )

-- Visual Basic --

nRet = mdOpenDevice ( "MPEGVideo" )  -- MPEG device is opened

nFileHandle = mdOpen( WindowHandle, "D:\Video\Vid1.mpg", 30, 40, 0, 0, 0, 0, 2, 0 )

-- Later in the program ( just before exiting )

mdCloseDevice( "MPEGVideo" )

See Also:  	mdOpenDevice

Note:  The name of the device varies by manufacturer.  The above example will only work if the device name matches the device name in your system.


mdCloseGraphic

Description:  Closes a bitmap file and releases the associated memory.  This command also erases the graphic from the video image.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None.

Example:	To close a bitmap graphic associated with a particular video.

-- Authorware --

mdCloseGraphic ( nFileHandle )

-- Visual Basic --

Call mdCloseGraphic( nFileHandle )

See Also:  	mdOpenGraphic, mdOpenGraphicKeep, mdDisplayGraphic, mdShowGraphic, mdShowGraphicPos, mdHideGraphic


mdCloseInterface

Description:  Closes the custom graphical interface and releases the system resources;  this includes the graphic bitmap and the interface description data.  This command should only be called after all files using the interface have been closed.  The Media Control Library will not let an interface be closed while it is in use.

Parameters:	Interface Handle.	Integer.	Handle of the custom graphic interface information.  A value of zero (0) will close all custom interfaces not in use.

Return:	Integer.	A zero value indicates the close was successful.

Example:

-- Authorware --

nRet := mdCloseInterface (nInterfaceHandle)

or

nInterfaceHandle := mdCloseInterface(nFileHandle)

This will set nInterfaceHandle equal to 0 if the close was successful or leave it the same if the close fails.

-- Visual Basic --

nRet = mdCloseInterface (nInterfaceHandle)

or

nInterfaceHandle = mdCloseInterface(nFileHandle)

This will set nInterfaceHandle equal to 0 if the close was successful or leave it the same if the close fails.

See Also:	mdOpenInterface, mdGetButtonClicked


mdDisplayErrorMsgs

Description:  Sets the level of error message display.  Error messages can be turned off or turned on through this command.

Parameters:  	ErrorFlag.  Integer.  Turns the error messages on (default) or off.

1:  Error messages on. ( Default )

0:  Error messages off.

Return: 	None

Example:	To set the error display level to ignore error message display.

-- Authorware --

mdDisplayErrorMsgs ( 0 )

-- Visual Basic --

Call mdDisplayErrorMsgs( 0 )

See Also:  	mdGetErrorNumber, mdGetErrorText,,

mdLogErrors


mdDisplayGraphic

Description:  Loads and displays a bitmap graphic in the video window.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Filename	String.  The filename of the graphic to be loaded.  This filename should contain the full path to insure proper loading of the graphic.

nXPos	Integer.  Indicates the X pixel coordinate of the graphic within the video window.

nYPos	Integer.  Indicates the Y pixel coordinate of the graphic within the video window.

Palette	Integer.  A flag that tells the command to realize the graphic file palette or to ignore the palette and continue to use the current palette.

A zero (0) will ignore the graphic file palette.

A non-zero value will cause the command to realize the graphic file palette.

Return: 	Success	Integer.  If the command was successful, the value returned will be 1.

Example:	To display a graphical bitmap in the video window in position 30, 40.

-- Authorware --

nRet := mdDisplayGraphic( nFileHandle, 30, 40, "C:\\GRAPHICS\\GR0001.BMP", 0 )

-- Visual Basic --

nRet = mdDisplayGraphic( nFileHandle, 30, 40, "C:\GRAPHICS\GR0001.BMP", 0 )

See Also:  	mdOpenGraphic, mdOpenGraphicKeep, mdHideGraphic, mdShowGraphic, mdShowGraphicPos, mdCloseGraphic


mdFileDoesExist

Description:  Returns a value of 1 if the file listed as an argument IS found.  This command is helpful for detecting error situations such as a missing file.  The complete path should be passed to the command.

Parameters:  	Filename	String.  The name of the file to be searched.

Return: 	Flag	Integer.  A non-zero value if the file WAS found.  A value of  0 is returned if the file is not found.

Example:	To search for the file "myvideo.mpg".

-- Authorware --

if mdFileDoesExist ( "myvideo.mpg" ) then
GoTo( IconID@"Play MyVideo")

else

GoTo( IconID@"ErrorIcon")

end if

-- Visual Basic --

If Not mdFileDoesExist( "myvideo.mpg" ) Then

    MsgBox  "Cant Find myvideo.mpg"

    Exit Sub

End If

See Also:  	mdFileDoesNotExist


mdFileDoesNotExist

Description:  Returns a value of 1 if the file listed as an argument IS NOT found.  This command is helpful for detecting error situations such as a missing file.  The complete path should be passed to the command.

Parameters:  	Filename	String.  The name of the file to be searched.

Return: 	Flag	Integer.  A value of 1 if the file was NOT found.  A value of  0 is returned if the file is found.

Example:	To search for the file "myvideo.mpg".

-- Authorware --

if mdFileDoesNotExist ( "myvideo.mpg" ) then
GoTo( IconID@"ErrorIcon")

else

GoTo( IconID@"Play MyVideo")

end if

-- Visual Basic --

If mdFileDoesNotExist( "myvideo.mpg" ) Then

    MsgBox  "Cant Find myvideo.mpg"

    Exit Sub

End If

See Also:  	mdFileDoesExist


mdGetAreaClicked

Description:  Returns the video window area clicked by the user.  The video window is divided into 16 equal sized areas numbered 1 through 16.  The video window is split into an upper and lower section each with 8 individual areas.  The upper section contains areas 1 to 8 (right to left) and the lower section contains areas 9 to 16 (right to left).  The size of the areas depend on the size of the video window.  All video windows contain 16 areas.  This capability must be turned on through the mdSetWindowInteractive command.  This command can be used in conjunction with mdGetFrame to identify moving objects within the video.  Note: This is a way to provide interactivity through the video window but it is a set of static areas for this version.  Future enhancements will allow identification of specific video objects.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	ClickArea	Integer.  The area clicked by the user.

0:	No area has been clicked by the user.

1-16:	The numbered area clicked by the user.

Example:	To check for user interaction, i.e. clicking within the video window.

-- Authorware --

nAreaClicked := mdGetAreaClicked ( nFileHandle )

-- Visual Basic --

nAreaClicked = mdGetAreaClicked ( nFileHandle )

See Also:  	mdSetWindowInteractive


mdGetButtonClicked

Description:  Returns the last control clicked in the Media Control Library graphical interface.  This allows the application to react to the clicking of a particular button or scroll bar component.

Note:  Calling this command resets the internal button clicked value to zero (0).  The values returned:

0:	No button clicked	8:	Restart

1:	Step Left	9:	Rewind

2:	Step Right	11:	Scroll Thumb

3:	Play/Pause	12:	Custom

4:	Play	21:	Jump Left

5:	Pause	22:	Jump Right

6:	Close

7:	Stop

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return:	Integer	See above description.

Example:

-- Authorware --

nButtonClicked := mdGetButtonClicked (nFileHandle)

-- Visual Basic --

nButtonClicked = mdGetButtonClicked (nFileHandle)

See Also:	mdOpenInterface, mdCloseInterface


mdGetClipFrame

Description:  Returns the current frame in relation to the identified clip.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	Frames	Long.  Current clip frame

Example:	To get the current  frame of the A/V file clip.

-- Authorware --

CurrClipFrame := mdGetClipFrame( nFileHandle )

-- Visual Basic --

CurrClipFrame = mdGetClipFrame( nFileHandle )

See Also:  	mdGetFrame, mdSetClip, mdGotoFrame


mdGetClipLength

Description:  Returns the length of the identified clip in frames.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	Frames	Long.  Clip length in frames.

Example:	To get the clip length of the current A/V file.

-- Authorware --

ClipLen := mdGetClipLength( nFileHandle )

-- Visual Basic --

ClipLen =  mdGetClipLength( nFileHandle )

See Also:  	mdGetLength


mdGetCtrlWindowHandle

Description:  Returns the window handle of the Control Bar window.  This handle can be used by the programmer to perform specific Windows functions which require with window handle.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	Handle	Integer.  The window handle of the Control Bar window.

Example:	To determine the window handle of a particular video file.

-- Authorware --

hwndCtrl := mdGetCtrlWindowHandle ( nFileHandle )

-- Visual Basic --

hwndCtrl = mdGetCtrlWindowHandle ( nFileHandle )

See Also:  	mdGetDeviceID, mdGetWindowHandle


mdGetCtrlWinPos

Description:  Returns the position of the Control Bar in client window coordinates.  The values are passed back via the 2nd and 3rd arguments in the subroutine call.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

XPos	Integer Pointer.  Control Bar X Coordinate is passed back through this variable.

YPos	Integer Pointer.  Control Bar Y Coordinate is passed back through this variable.

Return:  	None

Example:	To get the current position of the Control Bar.

-- Authorware --

N/A

-- Visual Basic --

Call mdGetCtrlWinPos( nFileHandle, XPos, YPos )

XPos and YPos will contain the X and Y coordinates of the Control Bar.

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetCtrlWinSize

Description:  Returns the size of the Control Bar in pixels.  The value is passed back via the 2nd argument in the subroutine call.  The height of the Control Bar is static therefore a height parameter is unnecessary.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

nWidth	Integer Pointer.  Control Bar Width is passed back through this variable.

Return:  	None

Example:	To get the current size of the Control Bar.

-- Authorware --

N/A

-- Visual Basic --

Call mdGetCtrlWinSize( nFileHandle, nWidth )

nWidth and nHeight will contain the width of the Control Bar.

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetCtrlWinWidth

Description:  Returns the current width of the Control Bar.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nWidth	Integer.  Control Bar width

Example:	To get the width of the current Control Bar.

-- Authorware --

CtrlWidth := mdGetCtrlWinWidth( nFileHandle )

-- Visual Basic --

CtrlWidth = mdGetCtrlWinWidth( nFileHandle )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight


mdGetCtrlWinX

Description:  Returns the current X coordinate of the Control Bar.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nXPos	Integer.  X coordinate

Example:	To get the X coordinate of the current Control Bar.

-- Authorware --

XPos := mdGetCtrlWinX( nFileHandle )

-- Visual Basic --

XPos = mdGetCtrlWinX( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinY, mdSetWindowMoveable


mdGetCtrlWinY

Description:  Returns the current Y coordinate of the Control Bar.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nYPos	Integer.  Y coordinate

Example:	To get the Y coordinate of the current Control Bar.

-- Authorware --

YPos := mdGetCtrlWinY( nFileHandle )

-- Visual Basic --

YPos = mdGetCtrlWinY( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdSetWindowMoveable


mdGetDeviceID

Description:  Returns the MCI device ID number.  This number can be used to perform programmer selected MCI commands.  A good knowledge of the MCI command interface is necessary before using this ID  number.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	DevID	Integer.  This value is the MCI device ID number used to control the video and audio.  The number can be used by the programmer to issue their own MCICommand functions.

Example:	To retrieve the device ID of a previously opened A/V file.

-- Authorware --

nDeviceID := mdGetDeviceID ( nFileHandle )

-- Visual Basic --

nDeviceID = mdGetDeviceID ( nFileHandle )

See Also:	mdGetWindowHandle


mdGetDisplayState

Description:  Returns the current state of display for the current A/V file.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	State	Integer.  Current display state.

0:	None	-  No part of the A/V interface is shown.

1:	Video	-  ONLY the Video Window is shown.

2:	Control Bar	-  ONLY the Control Bar is shown.

3:	Both	-  The entire A/V interface is shown.

Example:	To get the current display state.

-- Authorware --

DisplayState := mdGetDisplayState( nFileHandle )

-- Visual Basic --

DisplayState = mdGetDisplayState( nFileHandle )

See Also:	mdHide, mdShow, mdHideVideo, mdShowVideo, mdHideCtrl, mdShowCtrl


mdGetErrorNumber

Description:  This command retrieves error information from the A/V file.  The type of information retrieved depends on the type specified.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

nType	Integer.  Indicates the type of error information to retrieve.

Type	Information

0	Error Code - If a value other than 0 is returned, an error has occurred.

(See Appendix A)

1	Error Severity

1 = Command failed

2 = Invalid parameter

3 = Command ignored

4 = Command failed but processing continued

2	Error Count - The number of errors since the file was opened.

Return: 	The return value depends on the type specified.

Example:	Check to see if an error has occurred by retrieving the error code.

-- Authorware --

nError := mdGetErrorNumber( nFileHandle,  0)

-- Visual Basic --

nError = mdGetErrorNumber( nFileHandle,  0)

See Also:  	mdGetErrorText, mdLogErrors, mdDisplayErrorMsgs


mdGetErrorText

Description:  Use this command to retrieve error text associated with a specific code.

Parameters:  	nErrorNo	Integer.  The error code.

sErrText	String.  The variable used to hold the error text.

nLength	Integer.  The maximum length of the error text returned in the sErrText variable.

Return: 	None.

Example:	To retrieve the error text when an error occurs.

-- Authorware --

nError := mdGetErrorNumber( nFileHandle,  0)

if nError then

    sErrorText := RepeatString( " ", 80 )

    mdGetErrorText( nError, sErrorText, 80 )

end if

-- Visual Basic --

nError = mdGetErrorNumber( nFileHandle,  0)

If nError Then

    sErrorText = Space( 80 )

    mdGetErrorText( nError, sErrorText, 80 )

End If

This example retrieves the error code.  Then, if there is an error, the text associated with the error code is placed in the sErrorText.

See Also:  	mdLogErrors, mdDisplayErrorMsgs, mdGetErrorNumber


mdGetFileName

Description:  This command retrieves the filename of any opened file.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

sFile	String.  The variable used to hold the filename.

nLenth	Integer.  The maximum length of the filename returned in the sFile variable.

Return: 	If the command is successful, the length of the filename in characters will be returned.  If it fails, a value of 0 will be returned

Example:	To retrieve the name of the file being controlled through file handle nFileHandle.

-- Authorware --

sFileName := RepeatString( " ", 80 )

nLen := mdGetFileName( nFileHandle, sFileName, 80 )

-- Visual Basic --

sErrorText = Space( 80 )

nLen = mdGetFileName( nFileHandle, sFileName, 80 )


mdGetFileType

Description:  Returns the type of the A/V file opened.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	Filetype	Integer.  A value that corresponds to an A/V file type.

0:	AVI	Video for Windows, Indeo, etc.

1:	AVS	Digital Video Interactive
(PLV or RTV)

2:	WAVE	Wave Audio

3:	MPEG	Motion Picture Expert Group
4:  MOV	Quicktime

Example:	To retrieve the file type of a previously opened A/V file.

-- Authorware --

nFileType := mdGetFileType ( nFileHandle )

-- Visual Basic --

nFileType = mdGetFileType ( nFileHandle )


mdGetFrame

Description:  Returns the current A/V file frame.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	Frame	Long.  Current frame

Example:	To get the currently displayed frame of the A/V file.

-- Authorware --

CurrFrame := mdGetFrame( nFileHandle )

-- Visual Basic --

CurrFrame = mdGetFrame( nFileHandle )

See Also:  	mdGetClipFrame, mdSetClip, mdGotoFrame


mdGetFrameRate

Description:    Returns the playback rate of the file.  If a value of 0 is returned, this means the drivers used to play your audio/video file do not support the command.

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return:	Frame Rate	Integer.  Playback rate of the file.

Example:

-- Authorware --

nFrameRate := mdGetFrameRate (nFileHandle)

-- Visual Basic --

nFrameRate = mdGetFrameRate (nFileHandle)

See Also:	mdSetPlaybackSpeed


mdGetLength

Description:  Returns the total length of the A/V file in frames.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	Frames	Long.  Total length in frames.

Example:	To get the length of the current A/V file.

-- Authorware --

lFileLen := mdGetLength( nFileHandle )

-- Visual Basic --

lFileLen =  mdGetLength( nFileHandle )

See Also:  	mdGetClipLength


mdGetOpenFileCount

Description:  Returns the number of A/V files currently open; files opened through the Media Control Library commands.

Parameters:  	None

Return: 	Open Files	Integer.  The number of currently open A/V files.

Example:	To determine the number of open files.

-- Authorware --

nFilesOpen := mdGetOpenFileCount (  )

-- Visual Basic --

nFilesOpen = mdGetOpenFileCount (  )

See Also:  	mdAbout


mdGetPlaybackSpeed

Description:  Gets the speed of playback of an opened file.  This will not work on all forms of video.  If the command is called and the playback speed returned is zero (0), the driver for the audio or video file does not support the command.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Return:	Speed	Integer.  Speed level from 0 (slowest) to
200 (double speed).  100 is normal.

Example:	To get the playback rate of a file.

-- Authorware --

nPlayRate := mdGetPlaybackSpeed ( nFileHandle )

-- Visual Basic --

nPlayRate = mdGetPlaybackSpeed ( nFileHandle )

See Also:  	mdSetPlaybackSpeed


mdGetPlayState

Description:  Returns the current state of play for the current A/V file.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nPlayState	Integer.  Current play state.

0:	Closed	-  No file is associated with the A/V interface.

1:	Playing	-  The file is playing.

2:	Seeking	-  The file is moving to a new frame.

3:	Paused	-  The file is paused.

4:	End	-  The file is at the end of the clip.

5:	Stopped	-  The file is in a stopped state.

Example:	To get the current play state.

-- Authorware --

nPlayState := mdGetPlayState( nFileHandle )

-- Visual Basic --

nPlayState = mdGetPlayState( nFileHandle )

See Also:	mdPlay, mdPause


mdGetPlayedStatus

Description:  Indicates whether a file has been played since it has been opened.

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return:	Played Status	Integer.  Play indicator.  Returns a zero (false) if the file has not been played or a non-zero value if the file has been played.

Example:

-- Authorware --

bButtonPressed := mdGetPlayedStatus (nFileHandle)

-- Visual Basic --

bButtonPressed = mdGetPlayedStatus (nFileHandle)

See Also:	mdPlay, mdGetButtonClicked


mdGetPosClicked

Description:  Retrieves the X and Y position of the last mouse click in the video window.  The values returned are in video window coordinates.  When this call is made, the X and Y fields in the Library are reset back to 0.  This way it is easy to tell if a user has clicked in the video window and where.  If the value of nXPos or nYPos is anything other than 0, the user clicked in the video window.

Once the call is made, the values of nXPos and nYPos will be reset to 0 until the user clicks in the video window again.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

nXPos	Integer Pointer.  The value of the X coordinate clicked will be placed in this variable.

nYPos	Integer Pointer.  The value of the Y coordinate clicked will be placed in this variable.

Return:  	None

Example:	To get the location in the video window where the user clicked.

-- Authorware --

Not applicable.  Authorware does not allow the passing of values through variable pointers.

-- Visual Basic --

Call mdGetPosClicked( nFileHandle, nXPos, nYPos )

If nXPos or nYPos Then

' Process the user click

End If

See Also:  	mdSetWindowInteractive, mdGetXPosClicked, mdGetYPosClicked, mdGetAreaClicked,


mdGetVideoImage

Description:  Captures and saves the current video image in bitmap format to a file.  This command will only operate properly if the video format utilizes a VGA inlay technology such as Indeo, Quicktime, VfW, Cinepak, and some forms of MPEG.

Note:  If you try this command and get a blank image you are most likely using an overlay video technology.

Parameters:	Handle	Integer.  Filename String.  Name of the file in which to save the captured video image.

Return:	Integer.	Completion Code.  0 if successful.

Example:

-- Authorware --

nRet := mdGetVideoImage (nFileHandle, "c:\\MyApp\\Video1.bmp")

-- Visual Basic --

nRet = MdGetVideoImage (nFileHandle, "c:\MyApp\Video1.bmp")


mdGetVideoWinHeight

Description:  Returns the current height of the Video Window.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nHeight	Integer.  Video window height

Example:	To get the height of the current Video Window.

-- Authorware --

nHeight := mdGetVideoWinHeight( nFileHandle )

-- Visual Basic --

nHeight = mdGetVideoWinHeight( nFileHandle )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetCtrlWinWidth


mdGetVideoWinPos

Description:  Returns the position of the Video Window in client window coordinates.  The values are passed back via the 2nd and 3rd arguments in the subroutine call.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

XPos	Integer Pointer.  Video Window X Coordinate is passed back through this variable.

YPos	Integer Pointer.  Video Window Y Coordinate is passed back through this variable.

Return:  	None

Example:	To get the current position of the Video Window.

-- Authorware --

N/A

-- Visual Basic --

Call mdGetVideoWinPos( nFileHandle, XPos, YPos )

XPos and YPos will contain the X and Y coordinates of the Video Window.

See Also:	mdGetWinPos, mdSetWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetVideoWinSize

Description:  Returns the size of the Video Window in pixels.  The values are passed back via the 2nd and 3rd arguments in the subroutine call.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

nWidth	Integer Pointer.  Video Window Width is passed back through this variable.

nHeight	Integer Pointer.  Video Window Height is passed back through this variable.

Return:  	None

Example:	To get the current size of the Video Window.

-- Authorware --

N/A

-- Visual Basic --

Call mdGetVideoWinSize( nFileHandle, nWidth, nHeight )

nWidth and nHeight will contain the width and height of the Window.

See Also:	mdGetWinSize, mdSetWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetVideoWinWidth

Description:  Returns the current width of the Video Window.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nWidth	Integer.  Video window width

Example:	To get the width of the current Video Window.

-- Authorware --

nWidth := mdGetVideoWinWidth( nFileHandle )

-- Visual Basic --

nWidth = mdGetVideoWinWidth( nFileHandle )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetVideoWinX

Description:  Returns the current X coordinate of the Video Window.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	Integer	X coordinate

Example:	To get the X coordinate of the current Video Window.

-- Authorware --

XPos := mdGetVideoWinX( nFileHandle )

-- Visual Basic --

XPos = mdGetVideoWinX( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetVideoWinY

Description:  Returns the current Y coordinate of the Video Window.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nYPos	Integer.  Y coordinate

Example:	To get the Y coordinate of the current Video Window.

-- Authorware --

YPos := mdGetVideoWinY( nFileHandle )

-- Visual Basic --

YPos = mdGetVideoWinY( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetVolumeLevel

Description:  Returns the current volume level.  This number ranges between 0 (quiet) and 100 (full volume).

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return:	Volume Level.	Integer.  Volume level from 0 (quiet) to
100 (full volume).

Example:

-- Authorware --

nVolLevel := mdGetVolumeLevel (nFileHandle)

-- Visual Basic --

nVolLevel = mdGetVolumeLevel (nFileHandle)

See Also:	mdSetVolumeLevel, mdSetAudioMute


mdGetWindowHandle

Description:  Returns the window handle of the Video window.  This handle can be used by the programmer to perform specific Windows functions, such as drawing, or other graphic based functions.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	Handle	Integer.  The window handle of the Video window.

Example:	To determine the window handle of a particular video file.

-- Authorware --

hwndVideo := mdGetWindowHandle ( nFileHandle )

-- Visual Basic --

hwndVideo = mdGetWindowHandle ( nFileHandle )

See Also:  	mdGetDeviceID, mdGetCtrlWindowHandle


mdGetWinHeight

Description:  Returns the current height of the A/V Interface.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nHeight	Integer.  A/V Interface height

Example:	To get the height of the current A/V Interface.

-- Authorware --

nHeight := mdGetWinHeight( nFileHandle )

-- Visual Basic --

nHeight = mdGetWinHeight( nFileHandle )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetWinPos

Description:  Returns the position of the A/V Interface in client window coordinates.  The values are passed back via the 2nd and 3rd arguments in the subroutine call.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

The position returned is the upper left corner of the video window if the file accessed includes video.  If the file is wave audio only, the position returned is the upper left corner of the Control Bar.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

XPos	Integer Pointer.  A/V Interface X Coordinate is passed back through this variable.

YPos	Integer Pointer.  A/V Interface Y Coordinate is passed back through this variable.

Return:  	None

Example:	To get the current position of the A/V Interface.

-- Authorware --

N/A

-- Visual Basic --

mdGetWinPos  nFileHandle, XPos, YPos

XPos and YPos will contain the X and Y coordinates of the A/V Interface.

See Also:	mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetWinSize

Description:  Returns the size of the A/V Interface in pixels.  The values are passed back via the 2nd and 3rd arguments in the subroutine call.  This command is not available in Authorware as the calling conventions prohibit passing the necessary integer pointers to and from the DLL.

The size returned is the width and height of the video window if the file accessed includes video.  If the file is wave audio only, the size returned is the width and height of the Control Bar.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

nWidth	Integer Pointer.  A/V Interface Width is passed back through this variable.

nHeight	Integer Pointer.  A/V Interface Height is passed back through this variable.

Return:  	None

Example:	To get the current size of the A/V Interface.

-- Authorware --

N/A

-- Visual Basic --

Call mdGetWinSize( nFileHandle, nWidth, nHeight )

nWidth and nHeight will contain the width and height of the Video Window.

See Also:	mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetWinWidth

Description:  Returns the current width of the A/V Interface.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nWidth	Integer.  A/V Interface width

Example:	To get the width of the current A/V Interface.

-- Authorware --

nWidth := mdGetWinWidth( nFileHandle )

-- Visual Basic --

nWidth = mdGetWinWidth( nFileHandle )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdGetWinX

Description:  Returns the current X coordinate of the A/V Interface.  The position returned is the left side of the video window if the file accessed includes video.  If the file is wave audio only, the position returned is the left side of the Control Bar.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nXPos	Integer.  X coordinate

Example:	To get the X coordinate of the current A/V Interface.

-- Authorware --

XPos := mdGetWinX( nFileHandle )

-- Visual Basic --

XPos = mdGetWinX( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetWinY

Description:  Returns the current Y coordinate of the A/V Interface.  The position returned is the top side of the video window if the file accessed includes video.  If the file is wave audio only, the position returned is the top side of the Control Bar.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	nYPos	Integer.  Y coordinate

Example:	To get the Y coordinate of the current A/V Interface.

-- Authorware --

YPos := mdGetWinY( nFileHandle )

-- Visual Basic --

YPos = mdGetWinY( nFileHandle )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdGetXPosClicked

Description:  Retrieves the X position of the last mouse click in the video window.  The values returned are in video window coordinates.  When this call is made, the X field in the Library is reset back to 0.  This way it is easy to tell if a user has clicked in the video window and where.  If the value of nXPos or nYPos is anything other than 0, the user clicked in the video window.

Once the call is made, the values of nXPos will be reset to 0 until the user clicks in the video window again.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Return:  	nXPos	Integer.  The value of the X coordinate clicked will be placed in this variable.

Example:	To get the location in the video window where the user clicked.

-- Authorware --

nXPos := mdGetXPosClicked( nFileHandle )

nYPos := mdGetYPosClicked( nFileHandle )

if nXPos or nYPos then

' Process the user click

end if

-- Visual Basic --

nXPos = mdGetXPosClicked( nFileHandle )

nYPos = mdGetYPosClicked( nFileHandle )

If nXPos or nYPos Then

' Process the user click

End If

See Also:  	mdSetWindowInteractive, mdGetPosClicked, mdGetYPosClicked, mdGetAreaClicked,


mdGetYPosClicked

Description:  Retrieves the Y position of the last mouse click in the video window.  The values returned are in video window coordinates.  When this call is made, the Y field in the Library is reset back to 0.  This way it is easy to tell if a user has clicked in the video window and where.  If the value of nXPos or nYPos is anything other than 0, the user clicked in the video window.

Once the call is made, the values of nYPos will be reset to 0 until the user clicks in the video window again.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Return:  	nYPos	Integer.  The value of the Y coordinate clicked will be placed in this variable.

Example:	To get the location in the video window where the user clicked.

-- Authorware --

nXPos := mdGetXPosClicked( nFileHandle )

nYPos := mdGetYPosClicked( nFileHandle )

if nXPos or nYPos then

' Process the user click

end if

-- Visual Basic --

nXPos = mdGetXPosClicked( nFileHandle )

nYPos = mdGetYPosClicked( nFileHandle )

If nXPos or nYPos Then

' Process the user click

End If

See Also:  	mdSetWindowInteractive, mdGetPosClicked, mdGetXPosClicked, mdGetAreaClicked,


mdGotoFrame

Description:  Positions the A/V file at the specified frame.  The frame must be within the beginning and ending frame numbers passed in the "mdOpen" or "mdSetClip" commands.

Parameters:   	Handle	Integer.  Use the return value from mdOpen  as the handle.

Frame	Long.  Frame number to jump to.

Return:  	None

Example:	Jump to frame 400 or the closest reference frame.

-- Authorware --

mdGotoFrame( nFileHandle, 400 )

-- Visual Basic --

Call mdGotoFrame( nFileHandle, 400 )

See Also:  	mdSetClip, mdGetFrame, mdOpen


mdHide

Description:  Hides the A/V interface.

Parameters:   	Handle 	Integer.  Use the return value from mdOpen as the handle.

Return: 	None

Example:	To hide an A/V file.

-- Authorware --

mdHide( nFileHandle )

-- Visual Basic --

Call mdHide( nFileHandle )

See Also:  	mdShow, mdHideVideo, mdShowVideo, mdHideCtrl, mdShowCtrl


mdHideCtrl

Description:  Hides the Control Bar only.

Parameters:   	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To hide the Control Bar.

-- Authorware --

mdHideCtrl( nFileHandle )

-- Visual Basic --

Call mdHideCtrl( nFileHandle )

See Also:  	mdHide, mdShow, mdHideVideo, mdShowVideo, mdShowCtrl


mdHideGraphic

Description:  Hides the current graphic from the video window.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None.

Example:	To clear a graphical bitmap from a video window.

-- Authorware --

mdHideGraphic( nFileHandle )

-- Visual Basic --

Call mdHideGraphic( nFileHandle )

See Also:  	mdOpenGraphic, mdOpenGraphicKeep, mdDisplayGraphic, mdShowGraphic, mdShowGraphicPos, mdCloseGraphic


mdLogErrors

Description:  This command will allow all of the errors encountered to be logged into a text file.

Parameters:  	FileName	String.  Identifies the filename where the errors should be logged.

bLog	Integer.  Turns the error logging on or off.  A non-zero value turns the logging on while a value of 0 turns the logging off.

Return: 	If the command is successful the value returned will be the same as the bLog parameter.  If the command fails, the return value will be 0.

Example:	To log errors to a file named errors.txt.

-- Authorware --

nRet := mdLogErrors( FileLocation ^ "Errors.txt", True )

-- Visual Basic --

nRet := mdLogErrors( App.Path & "\Errors.txt", True )

See Also:  	mdGetErrorText, mdDisplayErrorMsgs, ,mdGetErrorNumber


mdHideVideo

Description:  Hides the Video Window only.

Parameters:   	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To hide the Video Window.

-- Authorware --

mdHideVideo( nFileHandle )

-- Visual Basic --

Call mdHideVideo( nFileHandle )

See Also:  	mdHide, mdShow, mdShowVideo, mdHideCtrl, mdShowCtrl


mdMCISendString

Description:  This allows you to send MCI command strings directly to the file.  It is not necessary to include an alias with the string as the alias is added automatically.  For example, the string to ask how many frames were dropped during play normally would be:  "status alias frames skipped".  With mdMCISendString the syntax is:  "status frames skipped".

Note:  It will always be better to use a Media Control Library command rather than a comparable MCI send string.  This is because of the extensive internal tracking done by the Library.  This command was provided as a link to user requirements not specifically addressed by the Library.

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

MCISendString.  String.  The MCI command to send to the file.

Return:	Long	Value returned from MCI.

Example:	To find out how many frames were dropped during play:

-- Authorware --

mdMCISendString (nFileHandle, status frames skipped)

-- Visual Basic --

Call mdMCISendString (nFileHandle, Status Frames Skipped)


mdOpen

Description:   This command checks for the existence of the specified file and (if available) opens the file and makes it ready for play.  Several parameters are required to size and position the A/V file.  These parameters are used for startup purposes and can be modified at any time.  A/V files can be placed anywhere on the screen and have several possible display states.

Parameters:	Handle  	Integer.  Window handle of the calling program or "parent". (Authorware: use the WindowHandle variable not WindowHandle().)

AVFile	String.  Filename of the A/V file to be opened and played.

nXPos	Integer.  Upper left X coordinate (pixels).

nYPos	Integer.  Upper left Y coordinate.

nWidth	Integer.  Width of Video Window  (Note:  The Control Bar automatically aligns itself).

Any width can be used within the 640 pixel boundary.

Standard window sizes can be created by specifying the size number in the width field and a 0 (zero) in the height field below.

0: Automatic Sizing - This is the same as 10 shown below.

1: 160x120 (1/16)
2: 242x183 (1/8)
3: 308x234 (1/4 - best for DVI)

4: 400x300 (2/3)
5: 480x360 (3/4)
6: 640x480 (full screen with Control Bar)

10:  Automatic Sizing - The Video Window is sized based on the original dimensions of the digital video file.  If this option is used with a WAVE format audio file, a Control Bar will be sized to a default width of 320 pixels.

nHeight	Integer.  Height of Video Window.  (use 0 if utilizing one of the above preset sizes)

lBegFrm	Long.  Beginning frame number to play (0 defaults to the first frame in the file).

lEndFrm	Long.  Ending frame number to play (0 defaults to the last frame in the file).

nType	Integer.  Type of Window to display.  Values:

1:	Modal - Contains the "close" button - screen is disabled when displayed.  Available with the standard control bar only.

2:	Modeless - screen is active while displayed.

3:	Modeless/ No Control Bar - Only displays the Video Window.

nPreload	Integer.  Preload/Immediate display.  Values:

0:	Immediately upon loading, the A/V file is displayed.

1:	Preload the file and keep it hidden until a "show" command is issued.

Return:	Handle  	Integer.  > 0 if successful.  < 1 if open failed.

Example 1:

-- Authorware --

nFileHandle := mdOpen(WindowHandle, "D:\\VIDEO\\WNDSURF1.AVI", 30, 40, 0, 0, 0, 0, 2, 0)

-- Visual Basic --

nFileHandle = mdOpen( Form1.hWnd, "D:\VIDEO\WNDSURF1.AVI", 30, 40, 0, 0, 0, 0, 2, 0)

This example opens the file "D:\VIDEO\WNDSURF1.AVI" and attaches the video window.  It then positions the window at coordinates (30, 40), the video window will be created that matches that of the video file (0, 0) and all frames (0, 0) will be played.  A modeless window will appear with a Control Bar (2). Finally, it will display video and make it ready for play (0).

Example 2:

-- Authorware --

nFileHandle := mdOpen(WindowHandle, "D:\\VIDEO\\WNDSURF1.AVI", 30, 40, 0, 0, 0, 0, 1, 0)

-- Visual Basic --

WindowHandle = Form1.hWnd

nFileHandle = mdOpen(WindowHandle, "D:\VIDEO\WNDSURF1.AVI", 30, 40, 0, 0, 0, 0, 1, 0)

This example opens the file "C:\WINVIDEO\WNDSURF1.AVI" and attaches the Video Window to WindowHandle (the parent).  It then positions the window at coordinates (30, 40), a Video Window size equal to the original source file is created (0, 0) and all frames (0, 0) are played.  A modal window will appear with a Control Bar including a close button (1). Finally, it will load the file and immediately display it (0).


Example 3:

-- Authorware --

nFileHandle := mdOpen(WindowHandle, "D:\\VIDEO\\WNDSURF1.AVI", 30, 40, 320, 240, 100, 200, 3, 1)

-- Visual Basic --

WindowHandle = Form1.hWnd

nFileHandle = mdOpen(WindowHandle, "D:\WINVIDEO\WNDSURF1.AVI", 30, 40, 320, 240, 100, 200, 3, 1)

This example opens the file "D:\WINVIDEO\WNDSURF1.AVI" and attaches the Video Window to WindowHandle (the parent).  It then positions the window at coordinates (30, 40), a Video Window size of 320x240 pixels is created and the file is set up to play the clip between frames (100, 200).  A modeless window will appear without a Control Bar (3). Finally, it will preload the file and make it ready for display and play (1). To view the video, "mdShow" must be used in this example.  If  0 was used in the preload parameter, "mdShow" would not be necessary.

Note:  A/V files can be played while they are hidden.  The video portion will not be seen but the audio can be heard.

See Also:  	mdClose


Type Caption for New Topic Right Here
User Interface Examples

Modal Interface With Control Bar


User Interface Examples

Modeless Interface With Control Bar


User Interface Examples

Modeless Interface Without Control Bar


Multiple File Access

One of the features of the Media Control Library is the ability to open and control multiple audio and video files concurrently.  It does this through the use of a file handle.  This handle is nothing more than a number generated by the Library that identifies a specific video that has been opened.  It is returned by the mdOpen command and then is the first parameter used in all of the subsequent commands that manipulate audio and video.  The examples below illustrate this:

Example: Open 2 files.  Show the first and make the second ready for later

nFileHandle1 = mdOpen(Form1.hWnd, "vid1.avi", 20,30, 0, 0, 0, 0, 2, 0)

nFileHandle2 = mdOpen(Form1.hWnd, "vid2.avi", 20,30, 0, 0, 0, 0, 2, 1)

:

'Later in the program

mdHide( nFileHandle1 )	' Hide the first

mdShow( nFileHandle2 )	' Show the second

Other commands may be some of the following

mdPlay( nFileHandle1, 0 )	-- Play the first file

mdPause( nFileHandle2 )	-- Pause the second file

mdStop( nFileHandle1 )	-- Stop the first file *

mdClose( nFileHandle1 )	-- Close the first file **

* NOTE:  mdStop must be used when dealing with multiple files.  This command will release the appropriate Windows resources so that other open files can play properly.  With DVI and MPEG files, the video image will disappear when this command is called.

** NOTE:  mdClose will close one file at a time with a specific file handle parameter or all open audio and video files with a zero ( 0 ) used in place of the file handle.  For example:

mdClose( 0 )	-- Closes ALL files previously opened with mdOpen command


mdOpenDevice

Description:  This command allows the driver for a particular technology to be opened prior to the opening of a specific file.  This will, in most cases, make the opening of the files occur much quicker.

The device will stay open until the device is closed (mdCloseDevice).  This means it can be opened once at the beginning of the program and then closed at the end.

Parameters:  	DeviceName	String.  This is the name of the device to be opened.

Return:  	If the command was successful, a value of 1 will be returned.  If the command fails a value of 0 is returned.

Example:	To open the MPEG Video device prior to opening an MPEG file.  Then later in the program, close the device.

-- Authorware --

nRet := mdOpenDevice ( "MPEGVideo" )  -- MPEG device is opened

nFileHandle := mdOpen( WindowHandle, "D:\\Video\\Vid1.mpg", 30, 40, 0, 0, 0, 0, 2, 0 )

-- Later in the program ( just before exiting )

mdCloseDevice( "MPEGVideo" )

-- Visual Basic --

nRet = mdOpenDevice ( "MPEGVideo" )  -- MPEG device is opened

nFileHandle = mdOpen( WindowHandle, "D:\Video\Vid1.mpg", 30, 40, 0, 0, 0, 0, 2, 0 )

-- Later in the program ( just before exiting )

mdCloseDevice( "MPEGVideo" )

See Also:  	mdCloseDevice

Note:  The name of the device varies by manufacturer.  The above example will only work if the device name matches the device name in your system.


mdOpenGraphic

Description:  Opens and loads a graphic into memory.  This command does not immediately show the graphic.  Use mdShowGraphic when the graphic is to be seen.  Review the mdDisplayGraphic command for a similar, but easier, function.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Filename	String.  The filename of the graphic to be loaded.  This filename should contain the full path to insure proper loading of the graphic.

Return: 	If the command is successful, a value of 1 will be returned.  If the command is unsuccessful, a negative value will be returned.

Example:	To open a bitmap graphic and associate it with a particular video.

-- Authorware --

nRet := mdOpenGraphic( nFileHandle, "C:\\GRAPHICS\\GR0001.BMP" )

-- Visual Basic --

nRet = mdOpenGraphic( nFileHandle, "C:\GRAPHICS\GR0001.BMP" )

This example opens the graphic file "C:\GRAPHICS\GR0001.BMP" and makes it ready for display.

See Also:  	mdOpenGraphicKeep, mdDisplayGraphic, mdShowGraphic, mdShowGraphicPos, mdHideGraphic, mdCloseGraphic


mdOpenGraphicKeep

Description:  Opens and loads a graphic into memory but does not remove the current image from the video window.  This command does not immediately show the graphic.  Use mdShowGraphic when the graphic is to be seen.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Filename	String.  The filename of the graphic to be loaded.  This filename should contain the full path to insure proper loading of the graphic.

Return: 	If the command is successful, a value of 1 will be returned.  If the command is unsuccessful, a negative value will be returned.

Example:	To open a bitmap graphic and associate it with a particular video.

-- Authorware --

nRet := mdOpenGraphicKeep( nFileHandle, "C:\\GRAPHICS\\GR0001.BMP" )

-- Visual Basic --

nRet = mdOpenGraphicKeep( nFileHandle, "C:\GRAPHICS\GR0001.BMP" )

This example opens the graphic file "C:\GRAPHICS\GR0001.BMP" and makes it ready for display.

See Also:  	mdOpenGraphic, mdDisplayGraphic, mdShowGraphic, mdShowGraphicPos, mdHideGraphic, mdCloseGraphic


mdOpenInterface

Description:  Opens a custom graphical interface for use with A/V files.  This option allows a user developed graphic to be used for the control bar rather than the default.  This command must be called before an mdOpen for it to affect the file.  When this command is called, the newly loaded interface will be used for any subsequent A/V file that is opened.

Multiple interfaces may be loaded (up to 16) at one time.  However, each interface requires and will use up some system resources.  The amount varies based on the size of the graphics loaded.

Note:  Graphical interfaces should be closed (mdCloseInterface) once they are no longer needed.  They should not, and actually cannot, be closed if they are in use by an A/V file.

Parameters:	Graphic.	String.  The graphic to be used in the control bar.

Control Bar Data.  String.  The data file which describes the graphical interface.  This file must be created through the CTRLBLDR.EXE program.  See Appendix B.

Return:	Handle.	Integer.  The interface handle associated with the control bar.

Example:

-- Authorware --

nInterfaceHandle := mdOpenInterface ("c:\\MyApp\\GrInt1.bmp",    "c:\\MyApp\\GrInt1.mcl")

-- Visual Basic --

nInterfaceHandle = mdOpenInterface ("c:\MyApp\GrInt1.bmp",    "c:\MyApp\GrInt1.mcl")

See Also:	mdCloseInterface, mdSetInterfaceNo,


mdOpenLite

Description: This command is equivalent to the mdOpen except that:

-  The size of the video window will default to the originally captured size unless changed through the mdSetWinSize command.

-  All of the frames will be played unless changed through the mdSetClip command.

-  The video window will appear as soon as the file has loaded.

-  The controlbar is either modeless or not shown.

If more control is required, review the mdOpen command

Parameters:	Handle  	Integer.  Window handle of the calling program or "parent". (Authorware: use the WindowHandle variable not WindowHandle().)

AVFile	String.  Filename of the A/V file to be opened and played.

nXPos	Integer.  Upper left X coordinate (pixels).

nYPos	Integer.  Upper left Y coordinate.

nType	Integer.  CtrlFlag.  Signifies whether the control bar should or should not be shown.  Values:

1:	(True) - Modeless control bar should appear.

0:	(False) - Control bar should not appear.

NOTE:  This command varies from the mdOpen command.  A modal video window cannot be opened with the mdOpenLite command.

Return:	Handle  	Integer.  > 0 if successful.  < 1 if open failed.

-- Authorware -- (All one line)

nFileHandle := mdOpenLite( WindowHandle, 	"C:\WINVIDEO\WNDSURF1.AVI", 30, 40, 2 )

-- Visual Basic -- (All one line)

nFileHandle = mdOpenLite( Form1.hWnd, 	"C:\WINVIDEO\WNDSURF1.AVI", 30, 40, 2 )

This example opens the file "C:\WINVIDEO\WNDSURF1.AVI" and attaches the Video Window to the parent window handle.  It then positions the window at coordinates (30, 40), a Video Window size equal to the original source file is created and all frames are played.  A modeless window will appear with a Control Bar.  Finally, it will load the file and immediately display.

See Also:	mdOpen, mdClose


mdPause

Description:  Pause the current clip. This is functionally equivalent to clicking the pause button on the Control Bar but can be controlled programmatically.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To pause a playing clip.

-- Authorware --

mdPause( nFileHandle )

-- Visual Basic --

Call mdPause( nFileHandle )

See Also:  	mdPlay, mdStop, mdGetPlayState


mdPlay

Description:  Begin play of the current clip.  Play will begin at the current frame and will continue to the end of an identified clip or to the end of the file if a specific clip was not identified.  This is functionally equivalent to clicking the play button on the Control Bar but can be controlled programatically.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Integer	Modal Switch - If set to 1 the screen will be disabled and the file will play until the end frame is reached.  Even if a Control Bar is present, the A/V file must play to the end.  That is, the file can be paused and played interactively but until the file reaches the very last frame (by playing), control will not be released back to the screen.

This option is best used without a Control Bar to play a required A/V file to completion.  (Type 3)

Return:  	None

Example 1:	To start a clip playing

-- Authorware --

mdPlay( nFileHandle, 0 )  -- 0 signifies normal play

-- Visual Basic --

Call mdPlay( nFileHandle, 0 )    ' 0 signifies normal play

Example 2:	To start a clip playing and force it to play to the end before control is released back to the screen.

-- Authorware --

mdPlay( nFileHandle, 1 )  -- 1 signifies play till done (last frame of the clip is reached).

-- Visual Basic --

Call mdPlay( nFileHandle, 1)    ' 1 signifies play till done (last frame of the clip is reached).

Note:  For additional modal and modeless operation see mdOpen and mdSetCtrlType.

See Also:  	mdPause, mdStep, mdGetPlayState


mdResetCtrlCursor

Description:  Resets the cursor shape for the Control Bar windows back to the default Windows arrow.  Note: This command resets the cursors for ALL Control Bar windows.

Parameters:	None

Return:  	None

Example:	To reset the Control Bar window cursor back to the default Windows default Windows arrow.

-- Authorware --

mdResetCtrlCursor(  )

-- Visual Basic --

Call mdResetCtrlCursor

See Also:	mdSetCursor, mdResetCursor, mdSetVideoCursor, mdResetVideoCursor, mdSetCtrlCursor


mdResetCursor

Description:  Resets the cursor shape for the Video and Control Bar windows back to the default Windows arrow.  Note: This command resets the cursors for ALL Video and Control Bars.

Parameters:	None

Return:  	None

Example:	To reset the Video and Control Bar cursor to the default Windows arrow.

-- Authorware --

mdResetCursor(  )

-- Visual Basic --

Call mdResetCursor

See Also:	mdSetCursor, mdSetVideoCursor, mdResetVideoCursor, mdSetCtrlCursor, mdResetCtrlCursor


mdResetVideoCursor

Description:  Resets the cursor shape for the Video windows back to the default Windows arrow.  Note: This command resets the cursors for ALL Video windows.

Parameters:	None

Return:  	None

Example:	To reset the Video window cursor back to the default Windows arrow.

-- Authorware --

mdResetVideoCursor(  )

-- Visual Basic --

Call mdResetVideoCursor

See Also:	mdSetCursor, mdResetCursor, mdSetVideoCursor, mdSetCtrlCursor, mdResetCtrlCursor


mdRestart

Description:  Repositions the video back to the starting frame of the clip and begins playing.  This command can be called while in a play or pause state.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To rewind the video back to the beginning of the clip and begin play.

-- Authorware --

mdRestart( nFileHandle )

-- Visual Basic --

Call mdRestart( nFileHandle )

See Also:  	mdRewind, mdGotoFrame


mdRewind

Description:  Repositions the video back to the starting frame of the clip. This command can be called while in a play or pause state.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To rewind the video back to the beginning of the clip.

-- Authorware --

mdRewind( nFileHandle )

-- Visual Basic --

Call mdRewind( nFileHandle )

See Also:  	mdRestart, mdGotoFrame


mdSetActivePalette

Description:  For use with Intel Indeo 3.2 and above.  This command identifies an alternate palette to be used with video display.  The palette file consists of color information in Microsofts .PAL file format.

This command can be called at any time but is most effective if called prior to opening any Indeo based file.

Note:  Any time the default palette for a video file is not used, video quality and/or performance is almost sure to degrade.

Parameters:	Palette File	String.  Specifies the file containing the palette information

Return:	Integer	A value of 1 indicates the command was successful.  A value of zero (0) means the command failed.

Example:	To use the palette file NEWPAL.PAL with a video instead of the standard Indeo palette.

-- Authorware --

mdSetActivePalette (c:\\MYVIDEO\\NEWPAL.PAL)

-- Visual Basic --

Call mdSetActivePalette (c:\MYVIDEO\NEWPAL.PAL)

See Also:	mdSetVideoPalette


mdSetAudioLevel

Description:  Sets the audio volume for the current A/V file.  Because of limitations in the MCI interface, mdSetAudioLevel will only affect AVS type files.

The parameter range is from 0 to 100.  At a level of 0, the audio is off.  100 is the maximum volume.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Level	Integer.  AudioLevel

 	0  --  --  -- --  100

Minimum 	Maximum

Return:  	None

Example 1:	To set the audio to half the maximum level.

-- Authorware --

mdSetAudioLevel( nFileHandle, 50 )

-- Visual Basic --

Call mdSetAudioLevel( nFileHandle, 50 )

Example 2:	To set the audio to the maximum level.

-- Authorware --

mdSetAudioLevel( nFileHandle, 100 )

-- Visual Basic --

Call mdSetAudioLevel( nFileHandle, 100 )

See Also:  	mdSetAudioMute


mdSetAudioMute

Description:  Mutes the audio or returns the audio back to the volume level prior to being muted.  The command acts as a toggle, turning the mute on or off with each successive call.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To mute the audio portion of an A/V file.

-- Authorware --

mdSetAudioMute ( nFileHandle )

-- Visual Basic --

Call mdSetAudioMute( nFileHandle )

See Also:  	mdSetAudioLevel


mdSetClip

Description:  Identifies a new clip to be played.  The A/V file is repositioned to the 1st frame of this clip.  Also, the scroll bar in the Control Bar will move as if this clip were the entire file.  That is, it will move faster as there are less frames to display.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

lBegFrm	Long.  Beginning frame of the clip.

lEndFrm	Long.  Ending frame of the clip.

Return:  	None

Example:	To set a clip from within a larger file to begin at frame 200 and end at frame 300.

-- Authorware --

mdSetClip( nFileHandle, 200, 300 )

-- Visual Basic --

Call mdSetClip( nFileHandle, 200, 300 )

See Also:	mdGetFrame, mdGetClipFrame


mdSetClippingRegion

Description:  Allows you to define a specific rectangular region of the video to display smaller than the original source video file size.  Several variations of this command exist through the format parameter.  Note: This command will work with ".AVI" or MPEG video files only.  It will not work with DVI (.AVS) format files.  This is due to a limitation in the DVI video drivers.  The commands can be called with DVI video, but the DVI driver will ignore the commands.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

XPos	Integer.  The X coordinate, in the video frame, of the region to be clipped.

YPos	Integer.  The Y coordinate, in the video frame, of the region to be clipped.

nWidth	Integer.  The width of the video region to be clipped.

nHeight	Integer.  The height of the video region to be clipped.

Format	Integer.  Signifies the display format of the resulting video image.  Five variations exist:

1:	Video clipped / video window resized - no scaling - video is cropped

and aligned.

2:	Video clipped / video window size unchanged - scaling - "ZOOM".

3:	Video clipped / video window size unchanged - no scaling - "As Is".

4:	Video clipped / video window size unchanged - no scaling - centered.

0:	Reset the image back to the original size - no clipping.

Return: 	None

Examples assume using a video file with a resolution of 160x120.

Example 1:	To clip a region of 100x80 at position 20,30 from the currently open video file and have the video window scale down to the new size of the video.

-- Authorware --

mdSetClippingRegion( nFileHandle, 20, 30, 100, 80, 1 )

-- Visual Basic --

Call mdSetClippingRegion( nFileHandle, 20, 30, 100, 80, 1)

The result will be a video window with a resolution of 100x80 and a video image that is not scaled.

Example 2:	To clip a region of 100x80 at position 20,30 from the currently open video file and have the video zoom up to the size of the original (160x120) video frame.

-- Authorware --

mdSetClippingRegion( nFileHandle, 20, 30, 100, 80, 2 )

-- Visual Basic --

Call mdSetClippingRegion( nFileHandle, 20, 30, 100, 80, 2)

The result will be a video window with a resolution of 160x120 and a scaled video image appearing as though it has been zoomed.

See Also:	mdSetWinSize, mdSetVideoWinSize


mdSetCtrlCursor

Description:  Sets the cursor shape for the Control Bar.  The shape is selected by passing the number 0 through 9 corresponding to a cursor in the table below.  Note: This command sets the cursors for Control Bars.  The cursor can be returned to the default Windows arrow by calling mdResetCtrlCursor.  This command can be called before or after any A/V files are opened.

Parameters:	Cursor	Integer.  Cursor number from the table below.  Number 0 is blank, that is, no cursor can be seen.

Return:  	None

Example:	To set the Control Bar cursor to be a hand.

-- Authorware --

mdSetVideoCursor( 1 )

-- Visual Basic --

Call mdSetCursor( 1 )

See Also:	mdSetCursor, mdResetCursor, mdSetVideoCursor, mdResetVideoCursor, mdResetCtrlCursor


mdSetCtrlType

Description:  Resets the type of A/V interface.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

nType	Integer.  Interface Type:

1:	Modal - Utilizes the "Close" button along with the scroll bar and "Play/Pause" button.  Access to the screen other than the A/V interface is ignored.  The A/V interface operates normally.

2:	Modeless - Only the scroll bar and the "Play/Pause" buttons are displayed.  Access to all parts of the screen is allowed at all times.

3:	Modeless - No Control Bar - All control of the A/V file must be done through "md" commands. (i.e., mdPlay, mdPause, etc.)  This approach allows the programmer to develop a custom interface for controlling the A/V file.

Return: 	None

Example:	To set the control interface to a modeless type without a Control Bar.

-- Authorware --

mdSetCtrlType( nFileHandle, 3 )

-- Visual Basic --

Call mdSetCtrlType( nFileHandle, 3 )

See Also:	mdOpen


mdSetCtrlWinPos

Description:  Repositions the Control Bar only.  The Video Window is unaffected.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To set the new position for the Control Bar to
coordinates (50, 75).

-- Authorware --

mdSetCtrlWinPos( nFileHandle, 50, 75 )

-- Visual Basic --

Call mdSetCtrlWinPos( nFileHandle, 50, 75 )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdSetCtrlWinSize

Description:  Resizes the Control Bar only.  The Video Window is unaffected.

Parameters:	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To set the new width for the Control Bar to 180

-- Authorware --

mdSetCtrlWinSize( nFileHandle, 180 )

-- Visual Basic --

Call mdSetCtrlWinSize( nFileHandle, 180 )

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdSetCursor

Description:  Sets the cursor shape for the Video and Control Bar windows.  The shape is selected by passing the number 0 through 9 corresponding to a cursor in the table below.  Note: This command sets the cursors for ALL Video and Control Bars.  The cursor can be returned to the default Windows arrow by calling mdResetCursor.  This command can be called before or after any A/V files are opened.

Parameters:	Cursor	Integer.  Cursor number from the table below.  Number 0 is blank, that is, no cursor can be seen.

Return:  	None

Example:	To set the Video and Control Bar cursor to a hand.

-- Authorware --

mdSetCursor( 1 )

-- Visual Basic --

Call mdSetCursor( 1 )

See Also:	mdResetCursor, mdSetVideoCursor, mdResetVideoCursor, mdSetCtrlCursor, mdResetCtrlCursor


mdSetInterfaceNo

Description:  This command sets the current custom interface number to a previously opened interface number.

Parameters:  	Handle	Integer.  Identifies the opened interface to make current.  Use the return value obtained from mdOpenInterface as the handle.

Return: 	The value returned is the current interface number.

Example:	To set the current custom interface to .

-- Authorware --

nIntHandle1 := mdOpenInterface( sIntName1, sMCLFile1 )

nIntHandle2 := mdOpenInterface( sIntName2, sMCLFile2 )

-- The current interface is now nIntHandle2

-- Later in the program

mdSetInterfaceNo( nIntHandle1 )

-- Visual Basic --

nIntHandle(0) = mdOpenInterface( sIntName1, sMCLFile1 )

nIntHandle(1) = mdOpenInterface( sIntName2, sMCLFile2 )

-- The current interface is now nIntHandle(1)

-- Later in the program

mdSetInterfaceNo( nIntHandle(0) )

See Also:  	mdOpenInterface, mdCloseInterface, mdGetButtonClicked


mdSetKeyColor

Description:  For use with overlay video (some forms of MPEG), this command will change the "transparent" color from the default.  The Media Control Library automatically sets the default color to black.  This command will set the color for all videos.

This command is very useful when displaying graphics over the video.  For example, if black is a color needed in a graphic image to be shown in the video window, a different color (possibly a shade of gray) can be identified as the transparent color.  To do this get the red, green and blue color values of the new color from the package that created the graphics.  A light gray could be ( 192, 192, 192 ).  After the mdSetKeyColor( 192, 192, 192 ) command is called the video will show through the light gray portions of the graphic.

Some standard color values:

Red	Green	Blue

Black	0	0	0

Lt. Gray	192	192	192

Drk. Gray	128	128	128

Pink	255	0	255

Yellow	255	255	0

Red	255	0	0

Green	0	255	0

Blue	0	0	255

White	255	255	255

Parameters:  	nRed 	Integer. (0-255) The red color component value.

nGreen 	Integer. (0-255) The green color component value.

nBlue 	Integer. (0-255) The blue color component value.

Return:  	None

Example:	To set the transparent color to dark gray, open a file and display a graphic in the video window.

-- Authorware --

mdSetKeyColor( 128, 128, 128 )

-- Open the video file

nFileHandle := mdOpen( WindowHandle, "D:\\Video\\Vid.mpg", 30, 30, 0, 0, 0, 0, 2, 0 )

-- Load and display a graphic in the video window

nRet := mdDisplayGraphic( nFileHandle, "c:\\Graphics\\VidGr.bmp", 0, 0, False )

-- Visual Basic --

Call mdSetKeyColor( 128, 128, 128 )

-- Open the video file

nFileHandle = mdOpen( Form1.hWnd, "D:\Video\Vid.mpg", 30, 30, 0, 0, 0, 0, 2, 0 )

-- Load and display a graphic in the video window

nRet = mdDisplayGraphic( nFileHandle, "c:\Graphics\VidGr.bmp", 0, 0, False )


mdSetNewParent

Description:  Transfers the Video and Control Bar to another window.  This command is useful for moving a video window from parent to parent without closing the video file.  The parent can even be set to another application, however, care must be taken when doing this.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Handle	Integer.  Identifies the "new" parent window to attach the Video and Control Bar.

Return: 	None

Example:	To move the Video and Control Bar windows to a new parent.

-- Authorware --

mdSetNewParent ( nFileHandle, hwndNewParent )

-- Visual Basic --

Call mdSetNewParent( nFileHandle, hwndNewParent )

See Also:  	mdGetWindowHandle


mdSetPlaybackSpeed

Description:  Changes the speed of playback faster or slower.  This command will not work on all forms of video.  If the command is called and the playback speed does not change, the device probably does not support the feature.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Speed	Integer.  Speed level from 0 (slowest) to
200 (double speed).  100 is normal.

Return:  	None

Example:	To set the playback rate of a file to half normal speed.

-- Authorware --

mdSetPlaybackSpeed ( nFileHandle, 50 )

-- Visual Basic --

Call mdSetPlaybackSpeed ( nFileHandle, 50 )

See Also:  	mdGetPlaybackSpeed


mdSetPlayRepeat

Description:  Causes an A/V file to automatically restart when the file reaches the end.  This command should be called after the file is opened and before the file is played.

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Repeat Flag	Integer.  A non-zero value turns the play repeat on.  A value of zero (0) turns the play repeat off.

Return:	Integer	Returns the value of 1 if the command is successful.  A value of zero (0) indicates the command failed.

Example:	These examples turn on the automatic repeat.

-- Authorware --

nRet := mdSetPlayRepeat (nFileHandle, True)

-- Visual Basic --

nRet = mdSetPlayRepeat (nFileHandle, True)

See Also:	mdOpen, mdPlay, mdRewind, mdRestart


mdSetTimeFormat

Description:  Causes an A/V file to be referenced in the new time format.  Formats can be frames, milliseconds, byte offsets, smpte code etc.  The driver for the video or audio must be able to handle the new format or the change will not take place.

Since the Media Control Library defaults to frames for video and milliseconds for wave audio, you must perform a slightly different open sequence to initiate the new time format.  The file must be opened, then the time format command must be called.

This command is useful with MPEG video since different drivers will jump to different actual frames when told to jump to a requested frame.  This is because frame locations are estimated by drivers.  This means that if you tell a MPEG video to jump to frame 1234 it may actually land on a frame significantly before or after the real frame 1234.  This also means that one MPEG board will estimate the actual frame differently than other boards.  The best way to work with actual locations with MPEG is to use byte offsets although they are more difficult to get and understand than frame numbers.

mdGetFrame will return the value of the current location in the time format specified.

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

TimeFormat	Integer.  A value from the table below.

0	Milliseconds

1	HMS

2	MSF

3	Frames

4	SMPTE 24

5	SMPTE 25

6	SMPTE 30

7	SMPTE 30 Drop

8	Byte Offsets

9	Samples

10	TMSF

Return:	Integer	Returns the value of 1 if the command is successful.  A value of zero (0) indicates the command failed.  If the command fails, it means the driver does not support the time format.

Example 1:	Change the time format to milliseconds:

-- Authorware --

-- Open the file

nFileHandle := mdOpen ( WindowHandle, sFileName, 30, 30, 0, 0, 0, 0, 2, 0 )

-- Set the format to milliseconds

nRet := mdSetTimeFormat( nFileHandle, 0 ) -- 0=milliseconds

-- Visual Basic --

 Open the file

nFileHandle = mdOpen ( Form1.hWnd, sFileName, 30, 30, 0, 0, 0, 0, 2, 0 )

 Set the format to milliseconds

nRet = mdSetTimeFormat( nFileHandle, 0 )

Example 2:	Change the time format to byte offsets and set a clip:

-- Authorware --

-- Open the file - don't set the clip here and don't show

--   Not showing is not necessary but jumping to a new frame

--   will not be seen this way

nFileHandle := mdOpen ( WindowHandle, sFileName, 30, 30, 0, 0, 0, 0, 2, 1 )

-- Set the format to byte offsets

nRet := mdSetTimeFormat( nFileHandle, 8 ) -- 8 = byte offset

mdSetClip( nFileHandle, 12843, 395032 )

mdShow( nFileHandle )  -- Show the video window

-- Visual Basic --

 Open the file - don't set the clip here and don't show

   Not showing is not necessary but jumping to a new frame

   will not be seen this way

nFileHandle = mdOpen ( Form1.hWnd, sFileName, 30, 30, 0, 0, 0, 0, 2, 1 )

 Set the format to byte offsets

nRet = mdSetTimeFormat( nFileHandle, 8 )  8 = byte offset

mdSetClip( nFileHandle, 12843, 395032 )

mdShow( nFileHandle )  ' Show the video window


mdSetVideoAspect

Description:  Sets a window size that all subsequent video files will fit within.  This command will permit the application to open any size or any type of video file and be assured that the video will fit within the specified area on the screen.

Parameters:  	nXPos	Integer.	The X coordinate of the video area.

nYPos	Integer.	The Y coordinate of the video area.

nWidth	Integer.	The width of the video area.

nHeight	Integer.	The height of the video area.

Justify	Integer.	Horizontal or vertical video justification.  This will center a video with lower resolution than the video area specified.

1:	Center the video horizontally within the video area only.

2:	Center the video vertically within the video area only.

3:	Center the video horizontally and vertically within the video area only.

Limit	Integer.	This parameter specifies whether the video should be sized to fit the exact width and height of the video area.

0:	Resize the video image to fit within the video area.  All video files will be resized larger or smaller in order to fit within the video area.

1:	Do not size the video.  The video will retain its original width and height.  This is important with video types that may have performance issues with resizing.

Return: 	None

Example:	To set the area so that all video images will:

- Start at position 30,30

- Fit within a size of 320x240

- Center all videos within the video area

- Limit the size of the of the videos to their original  "captured" sizes

-- Authorware --

mdSetVideoAspect ( 30, 30, 320, 240, 3, 1 )

-- Visual Basic --

Call mdSetVideoAspect( 30, 30, 320, 240, 3, 1 )

See Also:  	mdSetWinSize


mdSetVideoCursor

Description:  Sets the cursor shape for the Video windows.  The shape is selected by passing the number 0 through 9 corresponding to a cursor in the table below.  Note: This command sets the cursors for ALL Video windows.  The cursor can be returned to the original arrow by calling mdResetVideoCursor.  This command can be called before or after any A/V files are opened.

Parameters:	Cursor	Integer.  Cursor number from the table below.  Number 0 is blank, that is, no cursor can be seen.

Return:  	None

Example 1:	To set the Video window cursor to be blank (no cursor).

-- Authorware --

mdSetVideoCursor( 0 )

-- Visual Basic --

Call mdSetCursor( 0 )

Example 2:	To set the Video window cursor to be a hand.

-- Authorware --

mdSetVideoCursor( 1 )

-- Visual Basic --

Call mdSetCursor( 1 )

See Also:	mdSetCursor, mdResetCursor, mdResetVideoCursor, mdSetCtrlCursor, mdResetCtrlCursor


mdSetVideoOffset

Description:  Shifts the upper left corner of the video image by the number of pixels provided as arguments in the command.  This command moves the video image within the video window and not the video window.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Xoffset	Integer.  The number of pixels to shift the video image horizontally.

Yoffset	Integer.  The number of pixels to shift the video image vertically.

Return: 	None

Example:	To shift the video image down 10 and to the right 15 pixels.

-- Authorware --

mdSetVideoOffset ( nFileHandle, 10, 15 )

-- Visual Basic --

Call mdSetVideoOffset( nFileHandle, 10, 15 )

See Also:  	mdSetClippingRegion


mdSetVideoPalette

Description:  Sets the video to realize a color palette.  The default is to realize the current palette of the application.  mdSetVideoPalette can also force realization to the video palette.  Forcing to the video palette can cause palette flashes and strange colors in the application graphics.  The default is recommended.  Note: palette realization is not an issue when the color depth of the PC is greater than 256 colors or with hardware based video such as DVI or MPEG.  This command affects all video files.

Parameters:  	Flag	Integer.  Signifies the type of palette realization to be selected.

0:	Realize the application (background) palette.  	(Default)

1:	Realize the video palette.

Return: 	None

Example:	To force the application to realize the video palette.

-- Authorware --

mdSetVideoPalette ( 1 )

-- Visual Basic --

Call mdSetVideoPalette( 1 )

See Also:  	mdSetActivePalette


mdSetVideoWinPos

Description:  Repositions the Video Window only.  The Control Bar is unaffected.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

nXPos	Integer.  New upper left X coordinate.

nYPos	Integer.  New upper left Y coordinate.

Return:  	None

Example:	To set the new position for the Video Window to
coordinates 50, 75.

-- Authorware --

mdSetVideoWinPos( nFileHandle, 50, 75 )

-- Visual Basic --

Call mdSetVideoWinPos( nFileHandle, 50, 75 )

See Also:	mdGetWinPos, mdSetWinPos, mdGetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdSetVideoWinSize

Description:  Resizes the Video Window only.  The Control Bar is unaffected.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

nWidth	Integer.  New width of the Video Window.

nHeight	Integer.  New height of the Video Window.

Return:  	None

Example:	To set the new size for the Video Window to 160x120.

-- Authorware --

mdSetVideoWinSize( nFileHandle, 160, 120 )  or

mdSetVideoWinSize( nFileHandle, 1, 0 )  -- uses the standard window size

-- Visual Basic --

Call mdSetVideoWinSize( nFileHandle, 160, 120 )    or

Call mdSetVideoWinSize( nFileHandle, 1, 0     uses the standard window size of 160x120

See Also:	mdGetWinSize, mdSetWinSize, mdGetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdSetVolumeLevel

Description:  Sets the current volume level.  This number ranges between 0 (quiet) and 100 (full volume).

Parameters:	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Volume Level.	Integer.  Volume level from 0 (quiet) to
100 (full volume).

Return:	None

Example: To set the volume level to 50% of full:

-- Authorware --

mdSetVolumeLevel ( nFileHandle, 50 )

-- Visual Basic --

Call mdSetVolumeLevel ( nFileHandle, 50 )

See Also:	mdGetVolumeLevel, mdSetAudioMute


mdSetWinBottom

Description:  Causes the Video and Control Bar windows to move to the bottom of the Z-order within the current parent window.  This command does not hide windows unless the video window is placed behind another window.  This command can be used in any language but is more useful in a language that uses multiple windows such as C/C++ or Visual Basic.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To move the A/V windows to the top of the Z-order.

-- Authorware -- (Not very useful with Authorware unless using a DLL that places a window onto the Authorware Presentation Window)

mdSetWinBottom ( nFileHandle )

-- Visual Basic --

Call mdSetWinBottom( nFileHandle )

See Also:  	mdSetWinTop, mdShow, mdHide


mdSetWindowInteractive

Description:  Sets or resets the flag allowing the video window to be clickable.  This feature permits the video window to become an interactive part of the display.  The default value is off.  See mdGetAreaClicked for additional information.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Flag	Integer.

0:	Turns the clickable video feature off.

1:	Turns on the clickable video feature.

Return: 	None

Example:	To turn on the clickable video feature.

-- Authorware --

mdSetWindowInteractive ( nFileHandle, 1 )

-- Visual Basic --

Call mdSetWindowInteractive( nFileHandle, 1 )

See Also:  	mdGetAreaClicked


mdSetWindowMoveable

Description:  Enables and disables the moveable Video Window capability.  The Video Window defaults to non-moveable upon startup.  It can be enabled for movement by setting the MoveFlag within this command.  It can then be disabled by resetting the MoveFlag to 0.

With this flag set, the user can click-and-drag the Video Window around the screen at will.  Movement can be performed when the video is paused or playing.  During play, the movement could be rough since much of the CPU processing time is spent on video decompression.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

Flag	Integer.  MoveFlag

0:	Disable moveable Video Window

1:	Enable moveable Video Window

The Video Window defaults to non-moveable upon startup.

Return:  	None

Example 1:	To make the Video Window moveable.

-- Authorware --

mdSetWindowMoveable( nFileHandle, 1 )

-- Visual Basic --

Call mdSetWindowMoveable( nFileHandle, 1 )

Example 2:	To make the Video Window non-moveable.

-- Authorware --

mdSetWindowMoveable( nFileHandle, 0 )

-- Visual Basic --

Call mdSetWindowMoveable( nFileHandle, 0 )


mdSetWinPos

Description:  Identifies a new location to display the A/V interface.  The result is immediate and can be performed while the interface is visible or hidden.  If a Video Window and Control Bar are being used, the two will be moved in unison.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

nXPos	Integer.  New upper left X coordinate.

nYPos	Integer.  New upper left Y coordinate.

Return:  	None

Example:	To set the new position for the A/V interface to
coordinates (50, 75).

-- Authorware --

mdSetWinPos( nFileHandle, 50, 75 )

-- Visual Basic --

Call mdSetWinPos( nFileHandle, 50, 75 )

See Also:	mdGetWinPos, mdGetVideoWinPos, mdSetVideoWinPos, mdGetCtrlWinPos, mdSetCtrlWinPos, mdGetWinX, mdGetWinY, mdGetVideoWinX, mdGetVideoWinY, mdGetCtrlWinX, mdGetCtrlWinY, mdSetWindowMoveable


mdSetWinSize

Description:  Resizes the A/V interface.  Both Video Window and Control Bar are modified.  The size specifies the new width and height of the Video Window.  The Control Bar is attached to the bottom of the window.

Parameters:  	Handle	Integer.  Use the return value from mdOpen as the handle.

nWidth	Integer.  Width of the new window.

nHeight	Integer.  Height of the new window.

Return:  	None

Example:	To set the new size for the A/V interface to 160x120.

-- Authorware --

mdSetWinSize( nFileHandle, 160, 120 )  or

mdSetWinSize( nFileHandle, 1, 0 )  -- uses the standard window size

-- Visual Basic --

Call mdSetWinSize( nFileHandle, 160, 120 )  ' or

Call mdSetWinSize( nFileHandle, 1, 0 )	' uses the standard window size

See Also:	mdGetWinSize, mdGetVideoWinSize, mdSetVideoWinSize, mdGetCtrlWinSize, mdSetCtrlWinSize, mdGetWinWidth, mdGetWinHeight, mdGetVideoWinWidth, mdGetVideoWinHeight, mdGetCtrlWinWidth


mdSetWinTop

Description:  Causes the Video and Control Bar windows to move to the top of the Z-order within the current parent window.  This does not mean that the Control Bar will appear if it has hidden.  Hidden windows stay hidden until shown through the explicit mdShow commands.  This command can be used in any language but is more useful in a language that uses multiple windows such as C/C++ or Visual Basic.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To move the A/V windows to the bottom of the Z-order.

-- Authorware -- (Not very useful with Authorware unless using a DLL that places a window onto the Authorware Presentation Window)

mdSetWinBottom ( nFileHandle )

-- Visual Basic --

Call mdSetWinBottom( nFileHandle )

See Also:  	mdSetWinBottom, mdShow, mdHide


mdShow

Description:  Shows the A/V interface.  If both audio and video exist, and control type 1 or 2 is used, this command will display the Video Window and Control Bar.  If the file is audio only, the Control Bar will be displayed without the Video Window.

Parameters: 	Handle	Integer.  Use the return value from mdOpen as the handle.

Return: 	None

Example:	To show a hidden A/V file.

-- Authorware --

mdShow( nFileHandle )

-- Visual Basic --

Call mdShow( nFileHandle )

See Also:  	mdHide, mdHideVideo, mdShowVideo, mdHideCtrl, mdShowCtrl


mdShowCtrl

Description:  Shows the Control Bar only.

Parameters:   	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To show the Control Bar.

-- Authorware --

mdShowCtrl( nFileHandle )

-- Visual Basic --

Call mdShowCtrl( nFileHandle )

See Also:  	mdHide, mdShow, mdHideVideo, mdShowVideo, mdHideCtrl


mdShowGraphic

Description:  Shows the loaded bitmap graphic.  This command can be called while in a play or pause state.

Although this command can be used with any video format, it is especially useful with "overlay" type video such as DVI ("PLV" or "RTV") or MPEG video.  The overlay technique allows graphics to be displayed with a "keyed" or transparent color.  All of the pixels with the keyed color will permit the video image to show through.  If used with AVI format video the graphic will display while the video is in a paused state but will disappear when the video plays and there are no transparent colors.  The transparent color with DVI is black (RGB 0,0,0) while MPEG uses Pink (RGB 255, 0, 255).

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Palette	Integer.  A flag that tells the command to realize the graphic file palette or to ignore the palette and continue to use the current palette.

A zero (0) will ignore the graphic file palette.

A non-zero value will cause the command to realize the graphic file palette.

Note:  Typical usage would call for a zero value.  This would ignore the palette and not cause a graphic palette flash.

Return: 	If the command is successful, a value of 1 will be returned.  If the command is unsuccessful, a negative value will be returned.

Example:	To display a previously loaded graphic within a video window.

-- Authorware --

nRet := mdShowGraphic( nFileHandle, 0)

-- Visual Basic --

nRet = mdShowGraphic( nFileHandle,  0 )

This example shows the previously loaded graphic at video window position (0, 0) at the graphics original size.  The zero in the last parameter signifies that the graphic palette is not to be realized.  The current palette will continue to be the palette.

See Also:  	mdOpenGraphic, mdOpenGraphicKeep, mdDisplayGraphic, mdShowGraphicPos, mdHideGraphic, mdCloseGraphic


mdShowGraphicPos

Description:  Shows a bitmap graphic at a specific position and size within the video window.  This command can be called while in a play or pause state.

Although this command can be used with any video format, it is especially useful with "overlay" type video such as DVI ("PLV" or "RTV") or MPEG video.  The overlay technique allows graphics to be displayed with a "keyed" or transparent color.  All of the pixels with the keyed color will permit the video image to show through.  If used with AVI format video the graphic will display while the video is in a paused state but will disappear when the video plays and there are no transparent colors.  The transparent color with DVI is black (RGB 0,0,0) while MPEG uses Pink (RGB 255, 0, 255).

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

nXPos	Integer.  Indicates the X pixel coordinate of the graphic within the video window.

nYPos	Integer.  Indicates the Y pixel coordinate of the graphic within the video window.

nWidth	Integer.  Specifies the width of the graphic to display in the video window.

nHeight	Integer.  Specifies the height of the graphic to display in the video window

Palette	Integer.  A flag that tells the command to realize the graphic file palette or to ignore the palette and continue to use the current palette.

A zero (0) will ignore the graphic file palette.

A non-zero value will cause the command to realize the graphic file palette.

Note:  Typical usage would call for a zero value.  This would ignore the palette and not cause a graphic palette flash.

Return: 	If the command is successful, a value of 1 will be returned.  If the command is unsuccessful, a negative value will be returned.

Example:	To display a previously loaded graphic within a video window at a specific location and size.

-- Authorware --

nRet := mdShowGraphicPos( nFileHandle,  25, 10, 30, 40, 0)

-- Visual Basic --

nRet = mdShowGraphicPos( nFileHandle, 25, 10, 30, 40, 0 )

This example shows the previously loaded graphic at video window position (25, 10) at a size of (30 x 40).  The zero in the last parameter signifies that the graphic palette is not to be realized.  The current palette will continue to be the palette.

See Also:  	mdOpenGraphic, mdOpenGraphicKeep, mdDisplayGraphic, mdShowGraphic, mdHideGraphic, mdCloseGraphic


mdShowVideo

Description:  Shows the Video Window only.

Parameters: 	Handle	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To show the Video Window.

-- Authorware --

mdShowVideo( nFileHandle )

-- Visual Basic --

Call mdShowVideo( nFileHandle )

See Also:  	mdHide, mdShow, mdHideVideo, mdHideCtrl, mdShowCtrl


mdStep

Description:  Steps forward one frame.

Parameters:  	Handle 	Integer.  Use the return value from mdOpen as the handle.

Return:  	None

Example:	To advance the A/V file forward one frame.

-- Authorware --

mdStep( nFileHandle )

-- Visual Basic --

Call mdStep( nFileHandle )

See Also:  	mdPlay, mdPause


mdStop

Description:  Stops the play of an A/V file and releases the resources so that other A/V files can be played.  This is necessary for multiple files to operate properly.  For example, with DVI files, only one file can be played at a time; DVI can show only one video image at a time.  mdStop releases the video resources and allows other opened DVI files to play.  With AVI files, mdStop releases the audio resources so that another video file can play and be heard.  Multiple AVI files can be seen at one time but only one can be heard.

Note:  With some video types, the video image will become blank when it is stopped.

Parameters:  	Handle	Integer.  Identifies the opened file to reference and control.  Use the return value obtained from mdOpen as the handle.

Return: 	None

Example:	To stop a video file.

-- Authorware --

mdStop ( nFileHandle )

-- Visual Basic --

Call mdStop( nFileHandle )

See Also:  	mdPause


mdTimedDelay

Description:  Delays the execution of code for a specified amount of time.  This command is useful for timing events in applications but allows Windows to continue with normal operations.  Once the time delay is complete, execution will continue with the next line of code in the application.

Parameters:  	Seconds	Float.  The number of seconds to delay the code execution.

Return: 	None

Example:	To delay execution for a specified amount of time.

-- Authorware --

mdTimedDelay ( 2.5 )	-- Delays Authorware execution by 2.5 seconds

-- Visual Basic --

Call mdTimedDelay( .7 )	 Delays Visual Basic execution by .7 second


mdWaveClose

Description:  Closes a wave audio recording session.

Parameters:  	None.

Return:  	Success	Long.  A value of 0 means the command was successful.  Any non-zero number indicates an error.

Example:	To close a wave audio recording session.

-- Authorware --

lRet := mdWaveClose( )

-- Visual Basic --

lRet = mdWaveClose( )

See Also:  	mdWaveRecordInit, mdWaveRecord, mdWaveRecordSave, mdWaveRecordPlayback


mdWaveRecord

Description:  Records wave audio for a specified amount of time.  It can do this in a modal "wait till done" mode or concurrent mode.

Note: Following the recording of audio, the system will need up to 2 seconds ( varies by system) to finish the recording.

Parameters:  	Seconds 	Long.  Specified in milliseconds (1000/second), this is the length of the record.

Modal	Integer.  Indicated whether the record should complete fully before returning control to the system.

True : 	Modal - "Wait till done" mode

False:	Non-Modal - Concurrent mode.

Return:  	Success	Long.  A value of 0 means the command was successful.  Any non-zero number indicates an error.

Example:	To initialize and record a 5 second audio clip in concurrent mode.

-- Authorware --

mdWaveRecordInit( )

mdWaveRecord( 5000, False )

-- Visual Basic --

lRet = mdWaveRecordInit( )

lRet = mdWaveRecord( 5000, False )

See Also:  	mdWaveRecordInit, mdWaveClose, mdWaveRecordSave, mdWaveRecordPlayback


mdWaveRecordInit

Description:  Initializes the wave recording session.  This should be done prior to recording

Parameters:  	None

Return:  	Success	Long.  A value of 0 means the command was successful.  Any non-zero number indicates an error.

Example:	To initialize and record a 5 second audio clip..

-- Authorware --

mdWaveRecordInit( )

mdWaveRecord( 5000, False )

-- Visual Basic --

lRet = mdWaveRecordInit( )

lRet = mdWaveRecord( 5000, False )

See Also:  	mdWaveClose, mdWaveRecord, mdWaveRecordSave, mdWaveRecordPlayback


mdWaveRecordPlayback

Description:  Plays the recorded wave audio session.  This can happen before the file is saved to disk.

Parameters:  	None.	The current audio record session is utilized.

Return:  	Success	Long.  A value of 0 means the command was successful.  Any non-zero number indicates an error.

Example:	To play back a recorded session.

-- Authorware --

lRet := mdWaveRecordInit( ) -- Init

lRet := mdWaveRecord( 3000, True ) -- Record 3 seconds of audio before releasing control.

lRet := mdWaveRecordPlayback(  ) -- Play the audio just recorded.

-- Visual Basic --

lRet := mdWaveRecordInit( ) ' Init

lRet := mdWaveRecord( 3000, True ) ' Record 3 seconds of audio before releasing control.

lRet := mdWaveRecordPlayback(  ) ' Play the audio just recorded.

See Also:  	mdWaveRecordInit, mdWaveClose, mdWaveRecord, mdWaveRecordSave


mdWaveRecordSave

Description:  Saves the recorded wave data to a file.

Parameters:  	Filename	String.  The name of the wave file to save.

Return:  	Success	Long.  A value of 0 means the command was successful.  Any non-zero number indicates an error.

Example:	To save the recording session to disk.

-- Authorware --

lRet := mdWaveRecordSave ( sFileName )

-- Visual Basic --

lRet = mdWaveRecordSave ( sFileName )

See Also:  	mdWaveRecordInit, mdWaveClose, mdWaveRecord, mdWaveRecordPlayback